@font-face {
  font-family: 'ClassicalChinese';
  src: url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');
}

.main-container {
  width: 100%;
  min-height: 100vh;
  background-image: url('../img/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  overflow: auto;
}

/* 导航栏样式 */
.nav-bar {
  width: 100%;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-item {
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.2rem;
  color: #8B4513;
  cursor: pointer;
  transition: color 0.3s;
}

.nav-item:hover {
  color: #5D4037;
  text-decoration: underline;
}

.user-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #8B4513;
  background-color: #f0e6d2; /* 添加背景色 */
  transition: transform 0.2s, box-shadow 0.2s; /* 添加过渡效果 */
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(139, 69, 19, 0.6);
}

.user-avatar:active {
  transform: scale(0.95);
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  color: #8B4513;
  font-weight: bold;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-dropdown {
  position: absolute;
  top: 50px; /* 调整位置，确保在头像下方 */
  right: 0;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 10px;
  z-index: 1000; /* 提高z-index确保显示在最上层 */
  min-width: 100px;
  animation: dropdownFadeIn 0.2s;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-dropdown button {
  background-color: #8B4513;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  width: 100%; /* 确保按钮填满容器 */
  white-space: nowrap; /* 防止文本换行 */
}

.login-dropdown button:hover {
  background-color: #6D351A;
}

.content {
  width: 90%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.85);
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  margin-top: 30px;
  margin-bottom: 30px;
}

.title {
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 3rem;
  color: #8B4513;
  margin-bottom: 50px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.role-section {
  width: 100%;
  margin-bottom: 40px;
}

.role-title {
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.8rem;
  color: #5D4037;
  margin-bottom: 30px;
  text-align: left;
}

.role-icons {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.role-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s;
}

.role-item:hover {
  transform: scale(1.05);
}

.role-icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 10px;
  border: 3px solid #8B4513;
}

.role-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.role-name {
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.2rem;
  color: #5D4037;
}

.non-home-content {
  width: 100%;
  padding: 20px;
  text-align: center;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.5rem;
  color: #5D4037;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 版本选择按钮样式 */
.version-buttons {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 30px 0;
}

.version-btn {
  padding: 12px 25px;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.2rem;
  background-color: #f0e6d2;
  color: #8B4513;
  border: 2px solid #8B4513;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.version-btn:hover {
  background-color: #e6d8c0;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(139, 69, 19, 0.2);
}

.version-btn.active {
  background-color: #8B4513;
  color: white;
}

.version-content {
  margin-top: 30px;
  padding: 20px;
  background-color: rgba(240, 230, 210, 0.5);
  border-radius: 8px;
  border-left: 5px solid #8B4513;
}

.test-button {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #8B4513;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1rem;
}

.test-button:hover {
  background-color: #6D351A;
}

/* 登录提示弹窗 */
.login-alert {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(93, 64, 55, 0.9);
  color: white;
  padding: 15px 30px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 200;
  animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
}

.alert-content {
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.1rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, -20px); }
}

@media (max-width: 768px) {
  .role-icons {
    justify-content: center;
  }
  
  .role-icon {
    width: 100px;
    height: 100px;
  }
  
  .title {
    font-size: 2.5rem;
  }
  
  .nav-bar {
    padding: 0 15px;
  }
  
  .nav-links {
    gap: 15px;
  }
  
  .nav-item {
    font-size: 1rem;
  }
}

/* 功能提示框样式 */
.feature-prompt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.feature-prompt-content {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.feature-prompt-content h3 {
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.5rem;
  color: #8B4513;
  margin-bottom: 15px;
}

.feature-prompt-content p {
  font-size: 1.1rem;
  color: #5D4037;
  margin-bottom: 25px;
}

.feature-prompt-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.feature-prompt-buttons button {
  padding: 10px 20px;
  border-radius: 5px;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.feature-prompt-buttons .cancel-btn {
  background-color: #f0e6d2;
  color: #8B4513;
  border: 1px solid #8B4513;
}

.feature-prompt-buttons .cancel-btn:hover {
  background-color: #e6d8c0;
}

.feature-prompt-buttons .login-btn {
  background-color: #8B4513;
  color: white;
  border: none;
}

.feature-prompt-buttons .login-btn:hover {
  background-color: #6D351A;
}

/* 功能提示小弹窗样式 */
.feature-prompt-mini {
  position: absolute;
  z-index: 1000;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 220px;
  animation: popIn 0.2s ease-out;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.prompt-arrow {
  position: absolute;
  top: -8px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
}

.prompt-content {
  padding: 15px;
}

.prompt-content p {
  margin: 0 0 12px 0;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1rem;
  color: #5D4037;
  text-align: center;
}

.prompt-buttons {
  display: flex;
  justify-content: space-between;
}

.prompt-buttons button {
  padding: 6px 12px;
  border-radius: 4px;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.prompt-buttons .cancel-btn {
  background-color: #f0e6d2;
  color: #8B4513;
  border: 1px solid #d1c4b0;
}

.prompt-buttons .cancel-btn:hover {
  background-color: #e6d8c0;
}

.prompt-buttons .login-btn {
  background-color: #8B4513;
  color: white;
  border: none;
}

.prompt-buttons .login-btn:hover {
  background-color: #6D351A;
}